<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
function salt($num = 6)
{
    $str = '1234567890';
    $salt = substr(str_shuffle($str), 10, $num);
    return $salt;
}

function getSystem($key)
{
    $system = \think\Db::name('system')->where(['key'=>$key,'status'=>['>',0]])->find();
    if($system['type'] == 1){
    	$system['value'] = json_decode($system['value'],true);
    }
    return $system['value'];
}